Optimal. Leaf size=162 \[ \frac {1}{2} a^3 (7 A+2 C) x+\frac {a^3 (2 A+7 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {5 a^3 (A-C) \sin (c+d x)}{2 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 a d}-\frac {(A-4 C) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.27, antiderivative size = 162, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 33, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.121, Rules used = {4172, 4103,
4081, 3855} \begin {gather*} \frac {5 a^3 (A-C) \sin (c+d x)}{2 d}+\frac {a^3 (2 A+7 C) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {(A-4 C) \sin (c+d x) \left (a^3 \sec (c+d x)+a^3\right )}{2 d}+\frac {1}{2} a^3 x (7 A+2 C)-\frac {(A-C) \sin (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{2 a d}+\frac {A \sin (c+d x) \cos (c+d x) (a \sec (c+d x)+a)^3}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3855
Rule 4081
Rule 4103
Rule 4172
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+a \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x))^3 (3 a A-2 a (A-C) \sec (c+d x)) \, dx}{2 a}\\ &=\frac {A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 a d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x))^2 \left (2 a^2 (4 A-C)-2 a^2 (A-4 C) \sec (c+d x)\right ) \, dx}{4 a}\\ &=\frac {A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 a d}-\frac {(A-4 C) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {\int \cos (c+d x) (a+a \sec (c+d x)) \left (10 a^3 (A-C)+2 a^3 (2 A+7 C) \sec (c+d x)\right ) \, dx}{4 a}\\ &=\frac {5 a^3 (A-C) \sin (c+d x)}{2 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 a d}-\frac {(A-4 C) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{2 d}-\frac {\int \left (-2 a^4 (7 A+2 C)-2 a^4 (2 A+7 C) \sec (c+d x)\right ) \, dx}{4 a}\\ &=\frac {1}{2} a^3 (7 A+2 C) x+\frac {5 a^3 (A-C) \sin (c+d x)}{2 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 a d}-\frac {(A-4 C) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{2 d}+\frac {1}{2} \left (a^3 (2 A+7 C)\right ) \int \sec (c+d x) \, dx\\ &=\frac {1}{2} a^3 (7 A+2 C) x+\frac {a^3 (2 A+7 C) \tanh ^{-1}(\sin (c+d x))}{2 d}+\frac {5 a^3 (A-C) \sin (c+d x)}{2 d}+\frac {A \cos (c+d x) (a+a \sec (c+d x))^3 \sin (c+d x)}{2 d}-\frac {(A-C) \left (a^2+a^2 \sec (c+d x)\right )^2 \sin (c+d x)}{2 a d}-\frac {(A-4 C) \left (a^3+a^3 \sec (c+d x)\right ) \sin (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(364\) vs. \(2(162)=324\).
time = 4.31, size = 364, normalized size = 2.25 \begin {gather*} \frac {a^3 \cos ^5(c+d x) \sec ^6\left (\frac {1}{2} (c+d x)\right ) (1+\sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right ) \left (2 (7 A+2 C) x-\frac {2 (2 A+7 C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {2 (2 A+7 C) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}{d}+\frac {12 A \cos (d x) \sin (c)}{d}+\frac {A \cos (2 d x) \sin (2 c)}{d}+\frac {12 A \cos (c) \sin (d x)}{d}+\frac {A \cos (2 c) \sin (2 d x)}{d}+\frac {C}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {12 C \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}-\frac {C}{d \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {12 C \sin \left (\frac {d x}{2}\right )}{d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )}{16 (A+2 C+A \cos (2 (c+d x)))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.61, size = 153, normalized size = 0.94
method | result | size |
derivativedivides | \(\frac {A \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 A \,a^{3} \left (d x +c \right )+3 a^{3} C \tan \left (d x +c \right )+3 A \,a^{3} \sin \left (d x +c \right )+3 a^{3} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{3} C \left (d x +c \right )}{d}\) | \(153\) |
default | \(\frac {A \,a^{3} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+a^{3} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+3 A \,a^{3} \left (d x +c \right )+3 a^{3} C \tan \left (d x +c \right )+3 A \,a^{3} \sin \left (d x +c \right )+3 a^{3} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+A \,a^{3} \left (\frac {\cos \left (d x +c \right ) \sin \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )+a^{3} C \left (d x +c \right )}{d}\) | \(153\) |
risch | \(\frac {7 a^{3} A x}{2}+a^{3} x C -\frac {i A \,a^{3} {\mathrm e}^{2 i \left (d x +c \right )}}{8 d}-\frac {3 i A \,a^{3} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {3 i A \,a^{3} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {i A \,a^{3} {\mathrm e}^{-2 i \left (d x +c \right )}}{8 d}-\frac {i a^{3} C \left ({\mathrm e}^{3 i \left (d x +c \right )}-6 \,{\mathrm e}^{2 i \left (d x +c \right )}-{\mathrm e}^{i \left (d x +c \right )}-6\right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{d}+\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{2 d}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{d}-\frac {7 a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{2 d}\) | \(234\) |
norman | \(\frac {\left (\frac {7}{2} A \,a^{3}+a^{3} C \right ) x +\left (-\frac {7}{2} A \,a^{3}-a^{3} C \right ) x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-\frac {7}{2} A \,a^{3}-a^{3} C \right ) x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (\frac {7}{2} A \,a^{3}+a^{3} C \right ) x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-7 A \,a^{3}-2 a^{3} C \right ) x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (-7 A \,a^{3}-2 a^{3} C \right ) x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\left (14 A \,a^{3}+4 a^{3} C \right ) x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {5 a^{3} \left (A -C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 a^{3} \left (A +5 C \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 a^{3} \left (11 A -7 C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a^{3} \left (13 A -7 C \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a^{3} \left (23 A +5 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {7 \left (A +C \right ) a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{4}}-\frac {a^{3} \left (2 A +7 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {a^{3} \left (2 A +7 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(403\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 175, normalized size = 1.08 \begin {gather*} \frac {{\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} A a^{3} + 12 \, {\left (d x + c\right )} A a^{3} + 4 \, {\left (d x + c\right )} C a^{3} - C a^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 2 \, A a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 6 \, C a^{3} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, A a^{3} \sin \left (d x + c\right ) + 12 \, C a^{3} \tan \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.85, size = 148, normalized size = 0.91 \begin {gather*} \frac {2 \, {\left (7 \, A + 2 \, C\right )} a^{3} d x \cos \left (d x + c\right )^{2} + {\left (2 \, A + 7 \, C\right )} a^{3} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, A + 7 \, C\right )} a^{3} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (A a^{3} \cos \left (d x + c\right )^{3} + 6 \, A a^{3} \cos \left (d x + c\right )^{2} + 6 \, C a^{3} \cos \left (d x + c\right ) + C a^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int A \cos ^{2}{\left (c + d x \right )}\, dx + \int 3 A \cos ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 A \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int A \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int 3 C \cos ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int 3 C \cos ^{2}{\left (c + d x \right )} \sec ^{4}{\left (c + d x \right )}\, dx + \int C \cos ^{2}{\left (c + d x \right )} \sec ^{5}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.49, size = 230, normalized size = 1.42 \begin {gather*} \frac {{\left (7 \, A a^{3} + 2 \, C a^{3}\right )} {\left (d x + c\right )} + {\left (2 \, A a^{3} + 7 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (2 \, A a^{3} + 7 \, C a^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (5 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 5 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 3 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 9 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 9 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 7 \, A a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 7 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 1\right )}^{2}}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.74, size = 207, normalized size = 1.28 \begin {gather*} \frac {3\,A\,a^3\,\sin \left (c+d\,x\right )}{d}+\frac {7\,A\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,A\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,C\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {7\,C\,a^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {3\,C\,a^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {C\,a^3\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {A\,a^3\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{2\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________